from rest_framework import viewsets, mixins
from task.serializers import TaskLogSerializer
from task.models import TaskLog
from task.filters import TaskLogFilter


class TaskLogViewSet(viewsets.GenericViewSet, mixins.ListModelMixin):
    queryset = TaskLog.objects.all().order_by('-id')
    serializer_class = TaskLogSerializer
    filterset_class = TaskLogFilter
    ordering_fields = ('id',)

    def list(self, request, *args, **kwargs):
        return super().list(request, *args, **kwargs)
